﻿var express = require('express');
var router = express.Router();
var discountController = require('../controllers/discountcontroller')
// 优惠商品信息
router.get('/', function (req, res, next) {

  discountController.getAllDiscount(req, res)

});
// 优惠单个商品信息
router.get('/discountID', function (req, res, next) {
  discountController.getDiscountID(req, res)
});
// 搜索框
router.get('/find', function (req, res, next) {
  discountController.getFind(req, res)
});
//按分类查询
router.get('/disClass',function(req,res,next){
  discountController.getdisClass(req,res)
})
//按分类查询搜索
router.get('/getclassFind',function(req,res,next){
  discountController.getclassFind(req,res)
})
// 限时抢购
router.get('/time', function (req, res, next) {
  discountController.getTime(req,res)
});
router.post('/upImages', function (req, res, next) {
  discountController.upImages(req,res)
});
module.exports = router;